<template>
  <el-main class="main">
    <!-- 标题 筛选 添加 -->
    <el-row type="flex" justify="space-between">
      <el-col :span="6"><h3 class="table-title">用户页面</h3></el-col>
      <el-col :span="12" align="right" class="table-title-right">
        <el-input v-model="itemFilter" size="mini" class="iteminput" />
      </el-col>
    </el-row>
    <!-- 数据显示 -->
    <el-row :gutter="20" type="flex" class="el-row-bg">
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" @click.native="click('account', $event)">帐号管理</el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" @click.native="click('role', $event)">角色管理</el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" @click.native="click('organiz', $event)">组织管理</el-card>
      </el-col>
    </el-row>
  </el-main>
</template>
<script>
import { mapState } from 'vuex'
export default {
  name: 'TestpctList',
  props: {
    data: {
      type: Array,
      default: () => []
    },
    value: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      itemFilter: null
    }
  },
  computed: {
    ...mapState({
      service: state => state.service
    })
  },
  created() {
    this.initData()
  },
  methods: {
    // 初始化
    initData() {

    },
    async click(data, $event) {
      const result = await this.service.getCi({ category_id: data })
      if (result && result.flag) {
        console.log('result', result)
        this.$emit('explorerOpen', data, result.data, $event)
      }
    }
  }
}
</script>
<style scoped>
.main {
  padding: 1rem;
}
.table-title {
  padding-bottom: 1rem;
}
.iteminput {
  width: auto;
  margin-right: 1rem;
}
.table-title-right {
  white-space: nowrap;
}
.el-row-bg {
  flex-wrap: wrap;
}
.el-row-bg > div {
  padding-bottom: 1rem;
}
</style>
